# Disabling Warnings
options(warn = -1)
# Required Packages
packages = c('tseries','TSstudio','fBasics','rcompanion', 'forecast', 'lmtest', 'forecast', 'tsDyn', 'vars', 'readxl', 'PerformanceAnalytics', 'vrtest','pracma', 'rmgarch', 'urca', 'FinTS', 'zoo', 'rugarch', 'e1071', 'fGarch')
# Install all Packages with Dependencies
# install.packages(packages, dependencies = TRUE)
# Load all Packages
lapply(packages, require, character.only = TRUE)
[[1]]
[1] TRUE
[[2]]
[1] TRUE
[[3]]
[1] TRUE
[[4]]
[1] TRUE
[[5]]
[1] TRUE
[[6]]
[1] TRUE
[[7]]
[1] TRUE
[[8]]
[1] TRUE
[[9]]
[1] TRUE
[[10]]
[1] TRUE
[[11]]
[1] TRUE
[[12]]
[1] TRUE
[[13]]
[1] TRUE
[[14]]
[1] TRUE
[[15]]
[1] TRUE
[[16]]
[1] TRUE
[[17]]
[1] TRUE
[[18]]
[1] TRUE
[[19]]
[1] TRUE
[[20]]
[1] TRUE
equity <- read.csv("./Dataset/Equity_Combined.csv")
Data already combined, cleaned, and pre-processed using Excel.
These are the closing prices of benchmark indices of the largest
equity exchange of 5 countries:
1. Brazil - Ibovespa: The Ibovespa is
the benchmark index of the B3 (Brasil Bolsa Balcão), which is the main
stock exchange in Brazil, consisting of the most traded stocks in the
Brazilian market.
2. China - Shanghai Composite Index: The Shanghai Composite tracks all stocks (A-shares and B-shares) listed on the Shanghai Stock Exchange. It is the most commonly used benchmark for the Chinese stock market.
3. Indonesia - Jakarta Composite Index (JCI): The JCI is the main stock market index of the Indonesia Stock Exchange (IDX), tracking the performance of all listed companies.
4. India - NIFTY 50: It is the main index of India’s National Stock Exchange (NSE) which features majority of listed companies in India.
5. Mexico - BMV IPC: This index is the benchmark for the Mexican stock market, consisting of a selection of the most liquid stocks listed on the Bolsa Mexicana de Valores (BMV).
head(equity)
# Changing the Date Format to 'yyyy-mm-dd'
equity$Common.Date <- as.Date(equity$Common.Date, format = "%d-%m-%Y")
head(equity)
# Calculate Log Return for entire file
LR_Equity = CalculateReturns(equity, method="log")[-1,]
head(LR_Equity)
Null Hypothesis (H0): The data has a unit root, which means it is non-stationary.
Alternative Hypothesis (H1): The data does not have a unit root, which means it is stationary
adf.test(LR_Equity$Brazil, alternative = "stationary")
Warning: p-value smaller than printed p-value
Augmented Dickey-Fuller Test
data: LR_Equity$Brazil
Dickey-Fuller = -7.8633, Lag order = 8, p-value = 0.01
alternative hypothesis: stationary
Null Hypothesis is Rejected, Log Return Series for Brazil is Stationary.
adf.test(LR_Equity$Indonesia, alternative = "stationary")
Warning: p-value smaller than printed p-value
Augmented Dickey-Fuller Test
data: LR_Equity$Indonesia
Dickey-Fuller = -8.9393, Lag order = 8, p-value = 0.01
alternative hypothesis: stationary
Null Hypothesis is Rejected, Log Return Series for Indonesia is Stationary.
adf.test(LR_Equity$India, alternative = "stationary")
Warning: p-value smaller than printed p-value
Augmented Dickey-Fuller Test
data: LR_Equity$India
Dickey-Fuller = -8.5792, Lag order = 8, p-value = 0.01
alternative hypothesis: stationary
Null Hypothesis is Rejected, Log Return Series for India is Stationary.
adf.test(LR_Equity$China, alternative = "stationary")
Warning: p-value smaller than printed p-value
Augmented Dickey-Fuller Test
data: LR_Equity$China
Dickey-Fuller = -8.4318, Lag order = 8, p-value = 0.01
alternative hypothesis: stationary
Null Hypothesis is Rejected, Log Return Series for China is Stationary.
adf.test(LR_Equity$Mexico, alternative = "stationary")
Warning: p-value smaller than printed p-value
Augmented Dickey-Fuller Test
data: LR_Equity$Mexico
Dickey-Fuller = -8.4528, Lag order = 8, p-value = 0.01
alternative hypothesis: stationary
Null Hypothesis is Rejected, Log Return Series for Mexico is Stationary.
Conclusion: All Log Returns are Stationary.
ts_plot(data.frame(LR_Equity$Mexico, equity$Common.Date[-1]))
Registered S3 methods overwritten by 'htmltools':
method from
print.html tools:rstudio
print.shiny.tag tools:rstudio
print.shiny.tag.list tools:rstudio
Registered S3 method overwritten by 'htmlwidgets':
method from
print.htmlwidget tools:rstudio
ts_plot(data.frame(LR_Equity$India, equity$Common.Date[-1]))
ts_plot(data.frame(LR_Equity$Brazil, equity$Common.Date[-1]))
ts_plot(data.frame(LR_Equity$China, equity$Common.Date[-1]))
ts_plot(data.frame(LR_Equity$Indonesia, equity$Common.Date[-1]))
Conclusion: The data seems to have Volatility Clustering, i.e. large changes in return are followed by large changes of either sign, but we need to test further.
Null Hypothesis (H0): The time series data does not exhibit significant autocorrelation up to lag k.
Alternative Hypothesis (H1): The time series data exhibits significant autocorrelation up to lag k.
# Finding optimal lag
VARselect(LR_Equity$Brazil, lag.max = 15, type = "const")
$selection
AIC(n) HQ(n) SC(n) FPE(n)
2 1 1 2
$criteria
1 2 3 4 5 6
AIC(n) -8.6961416569 -8.6985418188 -8.6970412173 -8.6948625929 -8.6924779286 -8.6912827726
HQ(n) -8.6904206132 -8.6899602531 -8.6855991298 -8.6805599834 -8.6753147973 -8.6712591194
SC(n) -8.6814473735 -8.6765003936 -8.6676526504 -8.6581268842 -8.6483950782 -8.6398527805
FPE(n) 0.0001672298 0.0001668289 0.0001670795 0.0001674439 0.0001678437 0.0001680445
7 8 9 10 11 12
AIC(n) -8.6879857505 -8.6873738462 -8.6857015397 -8.6827755181 -8.6799663119 -8.6833899646
HQ(n) -8.6651015754 -8.6616291492 -8.6570963208 -8.6513097773 -8.6456400493 -8.6462031801
SC(n) -8.6292086167 -8.6212495706 -8.6122301224 -8.6019569590 -8.5918006112 -8.5878771221
FPE(n) 0.0001685996 0.0001687029 0.0001689854 0.0001694807 0.0001699577 0.0001693771
13 14 15
AIC(n) -8.6814228314 -8.6781364407 -8.6750414553
HQ(n) -8.6413755250 -8.6352286124 -8.6292731051
SC(n) -8.5785628472 -8.5679293148 -8.5574871876
FPE(n) 0.0001697109 0.0001702699 0.0001707981
Optimal Lag = 2
Box.test(LR_Equity$Brazil, lag = 2)
Box-Pierce test
data: LR_Equity$Brazil
X-squared = 3.774, df = 2, p-value = 0.1515
Null Hypothesis can’t be rejected, there can be no significant autocorrelation at lag = 2.
# Finding optimal lag
VARselect(LR_Equity$Indonesia, lag.max = 15, type = "const")
$selection
AIC(n) HQ(n) SC(n) FPE(n)
4 1 1 4
$criteria
1 2 3 4 5 6
AIC(n) -9.707547e+00 -9.704204e+00 -9.703800e+00 -9.707698e+00 -9.7060465449 -9.702743e+00
HQ(n) -9.701826e+00 -9.695622e+00 -9.692358e+00 -9.693396e+00 -9.6888834136 -9.682720e+00
SC(n) -9.692853e+00 -9.682162e+00 -9.674411e+00 -9.670962e+00 -9.6619636946 -9.651313e+00
FPE(n) 6.082272e-05 6.102643e-05 6.105109e-05 6.081356e-05 0.0000609141 6.111567e-05
7 8 9 10 11 12
AIC(n) -9.699436e+00 -9.697360e+00 -9.702167e+00 -9.699370e+00 -9.696519e+00 -9.703667e+00
HQ(n) -9.676551e+00 -9.671616e+00 -9.673562e+00 -9.667904e+00 -9.662192e+00 -9.666480e+00
SC(n) -9.640659e+00 -9.631236e+00 -9.628696e+00 -9.618552e+00 -9.608353e+00 -9.608154e+00
FPE(n) 6.131819e-05 6.144562e-05 6.115103e-05 6.132236e-05 6.149755e-05 6.105961e-05
13 14 15
AIC(n) -9.700743e+00 -9.6997657137 -9.697933e+00
HQ(n) -9.660695e+00 -9.6568578854 -9.652165e+00
SC(n) -9.597883e+00 -9.5895585878 -9.580379e+00
FPE(n) 6.123852e-05 0.0000612985 6.141108e-05
Optimal Lag = 4
Box.test(LR_Equity$Indonesia, lag = 4)
Box-Pierce test
data: LR_Equity$Indonesia
X-squared = 6.9053, df = 4, p-value = 0.141
Null Hypothesis can’t be rejected, there can be no significant autocorrelation at lag = 4.
# Finding optimal lag
VARselect(LR_Equity$India, lag.max = 15, type = "const")
$selection
AIC(n) HQ(n) SC(n) FPE(n)
1 1 1 1
$criteria
1 2 3 4 5 6
AIC(n) -9.218895e+00 -9.215781e+00 -9.212748e+00 -9.215515e+00 -9.216971e+00 -9.213678e+00
HQ(n) -9.213174e+00 -9.207199e+00 -9.201306e+00 -9.201212e+00 -9.199808e+00 -9.193654e+00
SC(n) -9.204200e+00 -9.193739e+00 -9.183359e+00 -9.178779e+00 -9.172888e+00 -9.162248e+00
FPE(n) 9.914822e-05 9.945746e-05 9.975954e-05 9.948395e-05 9.933921e-05 9.966693e-05
7 8 9 10 11 12
AIC(n) -9.2103332603 -9.2073462683 -9.2045324682 -9.2014850493 -9.2008925517 -9.1991548894
HQ(n) -9.1874490852 -9.1816015713 -9.1759272494 -9.1700193085 -9.1665662891 -9.1619681049
SC(n) -9.1515561264 -9.1412219927 -9.1310610509 -9.1206664903 -9.1127268510 -9.1036420469
FPE(n) 0.0001000009 0.0001003001 0.0001005828 0.0001008899 0.0001009498 0.0001011255
13 14 15
AIC(n) -9.1965675892 -9.1932411739 -9.1912384348
HQ(n) -9.1565202828 -9.1503333456 -9.1454700847
SC(n) -9.0937076050 -9.0830340480 -9.0736841672
FPE(n) 0.0001013877 0.0001017257 0.0001019299
Optimal Lag = 1
Box.test(LR_Equity$India, lag = 1)
Box-Pierce test
data: LR_Equity$India
X-squared = 1.5163, df = 1, p-value = 0.2182
Null Hypothesis can’t be rejected, there can be no significant autocorrelation at lag = 1.
# Finding optimal lag
VARselect(LR_Equity$China, lag.max = 15, type = "const")
$selection
AIC(n) HQ(n) SC(n) FPE(n)
3 1 1 3
$criteria
1 2 3 4 5 6
AIC(n) -9.229989e+00 -9.226964e+00 -9.234669e+00 -9.231530e+00 -9.228438e+00 -9.225111e+00
HQ(n) -9.224268e+00 -9.218382e+00 -9.223227e+00 -9.217228e+00 -9.211275e+00 -9.205087e+00
SC(n) -9.215294e+00 -9.204922e+00 -9.205281e+00 -9.194795e+00 -9.184355e+00 -9.173681e+00
FPE(n) 9.805434e-05 9.835141e-05 9.759648e-05 9.790334e-05 9.820658e-05 9.853394e-05
7 8 9 10 11 12
AIC(n) -9.223730e+00 -9.2203858818 -9.217603e+00 -9.214262e+00 -9.2161787762 -9.213463e+00
HQ(n) -9.200845e+00 -9.1946411848 -9.188997e+00 -9.182797e+00 -9.1818525135 -9.176276e+00
SC(n) -9.164952e+00 -9.1542616062 -9.144131e+00 -9.133444e+00 -9.1280130754 -9.117950e+00
FPE(n) 9.867016e-05 0.0000990007 9.927671e-05 9.960897e-05 0.0000994184 9.968894e-05
13 14 15
AIC(n) -9.214654e+00 -9.212748e+00 -9.212860e+00
HQ(n) -9.174606e+00 -9.169840e+00 -9.167092e+00
SC(n) -9.111794e+00 -9.102541e+00 -9.095306e+00
FPE(n) 9.957045e-05 9.976061e-05 9.974959e-05
Optimal Lag = 3
Box.test(LR_Equity$China, lag = 3)
Box-Pierce test
data: LR_Equity$China
X-squared = 7.6383, df = 3, p-value = 0.05411
Null Hypothesis can’t be rejected, there can be no significant autocorrelation at lag = 3.
# Finding optimal lag
VARselect(LR_Equity$Mexico, lag.max = 15, type = "const")
$selection
AIC(n) HQ(n) SC(n) FPE(n)
1 1 1 1
$criteria
1 2 3 4 5 6
AIC(n) -9.0294129009 -9.0279678990 -9.0246259135 -9.0237324668 -9.0205855971 -9.0173324972
HQ(n) -9.0236918571 -9.0193863334 -9.0131838260 -9.0094298573 -9.0034224658 -8.9973088440
SC(n) -9.0147186174 -9.0059264738 -8.9952373466 -8.9869967581 -8.9765027467 -8.9659025051
FPE(n) 0.0001198328 0.0001200061 0.0001204079 0.0001205155 0.0001208954 0.0001212894
7 8 9 10 11 12
AIC(n) -9.0143629331 -9.0111028898 -9.011771762 -9.008449191 -9.0067476836 -9.0061946533
HQ(n) -8.9914787581 -8.9853581928 -8.983166543 -8.976983451 -8.9724214210 -8.9690078687
SC(n) -8.9555857993 -8.9449786143 -8.938300345 -8.927630632 -8.9185819828 -8.9106818108
FPE(n) 0.0001216501 0.0001220475 0.000121966 0.000122372 0.0001225805 0.0001226485
13 14 15
AIC(n) -9.0036532818 -9.00033295 -8.9971028545
HQ(n) -8.9636059754 -8.95742512 -8.9513345043
SC(n) -8.9007932976 -8.89012582 -8.8795485868
FPE(n) 0.0001229608 0.00012337 0.0001237694
Optimal Lag = 1
Box.test(LR_Equity$Mexico, lag = 1)
Box-Pierce test
data: LR_Equity$Mexico
X-squared = 0.68113, df = 1, p-value = 0.4092
Null Hypothesis can’t be rejected, there can be no significant autocorrelation at lag = 1.
Conclusion: All 5 series are likely to have no significant serial autocorrelation.
auto.arima(LR_Equity$Brazil)
Series: LR_Equity$Brazil
ARIMA(0,0,0) with zero mean
sigma^2 = 0.0001659: log likelihood = 1797.92
AIC=-3593.85 AICc=-3593.84 BIC=-3589.43
auto.arima(LR_Equity$India)
Series: LR_Equity$India
ARIMA(1,0,0) with non-zero mean
Coefficients:
ar1 mean
-0.0498 7e-04
s.e. 0.0404 4e-04
sigma^2 = 9.726e-05: log likelihood = 1962.69
AIC=-3919.37 AICc=-3919.33 BIC=-3906.12
auto.arima(LR_Equity$Indonesia)
Series: LR_Equity$Indonesia
ARIMA(0,0,0) with zero mean
sigma^2 = 6.072e-05: log likelihood = 2106.09
AIC=-4210.18 AICc=-4210.17 BIC=-4205.76
auto.arima(LR_Equity$China)
Series: LR_Equity$China
ARIMA(0,0,0) with zero mean
sigma^2 = 9.707e-05: log likelihood = 1962.28
AIC=-3922.56 AICc=-3922.55 BIC=-3918.14
auto.arima(LR_Equity$Mexico)
Series: LR_Equity$Mexico
ARIMA(0,0,0) with zero mean
sigma^2 = 0.0001176: log likelihood = 1903.39
AIC=-3804.79 AICc=-3804.78 BIC=-3800.37
All series, except India have AR Order = 0. -> There can be
Autocorrelation in Indian Stocks.
All series have MA order Order = 0. -> No Autocorrelation in
error/residual terms.
Conclusion: This confirms there is no autocorrelation in the error terms of all of the log return series, (bcz MA Order = 0), it may be suitable to apply ARCH/GARCH, if volatility clustering is confirmed.
ARIMA_India = arima(LR_Equity$India,order = c(1,0,0))
ARIMA_India
Call:
arima(x = LR_Equity$India, order = c(1, 0, 0))
Coefficients:
ar1 intercept
-0.0498 7e-04
s.e. 0.0404 4e-04
sigma^2 estimated as 9.694e-05: log likelihood = 1962.69, aic = -3919.37
# Significance of AR and MA
coeftest(ARIMA_India)
z test of coefficients:
Estimate Std. Error z value Pr(>|z|)
ar1 -0.04983399 0.04038180 -1.2341 0.21718
intercept 0.00073924 0.00038097 1.9404 0.05233 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Null Hypothesis (H0): The coefficient of the AR(1) term is zero, meaning the AR(1) term is not significant.
Alternative Hypothesis (H1): The coefficient of the AR(1) term is non-zero, meaning the AR(1) term is significant.
P > 0.05: Null Hypothesis can’t be rejected, this means AR Order of 1 might be non-significant for Indian Stocks.
Conclusion: AR(1) for Indian Stocks not significant, i.e. there is no autocorrelation.
Null Hypothesis (H0): There is no ARCH effect in the time series data. In other words, the variance of the residuals is constant over time (homoscedasticity).
Alternative Hypothesis (H1): There is an ARCH effect in the time series data. In other words, the variance of the residuals changes over time (heteroscedasticity)
ArchTest(LR_Equity$Brazil)
ARCH LM-test; Null hypothesis: no ARCH effects
data: LR_Equity$Brazil
Chi-squared = 30.955, df = 12, p-value = 0.002001
Null Hypothesis Rejected; there is conditional heteroscedasticity.
ArchTest(LR_Equity$China)
ARCH LM-test; Null hypothesis: no ARCH effects
data: LR_Equity$China
Chi-squared = 43.11, df = 12, p-value = 2.163e-05
Null Hypothesis Rejected; there is conditional heteroscedasticity.
ArchTest(LR_Equity$India)
ARCH LM-test; Null hypothesis: no ARCH effects
data: LR_Equity$India
Chi-squared = 52.56, df = 12, p-value = 4.932e-07
Null Hypothesis Rejected; there is conditional heteroscedasticity.
ArchTest(LR_Equity$Indonesia)
ARCH LM-test; Null hypothesis: no ARCH effects
data: LR_Equity$Indonesia
Chi-squared = 60.271, df = 12, p-value = 2.015e-08
Null Hypothesis Rejected; there is conditional heteroscedasticity.
ArchTest(LR_Equity$Mexico)
ARCH LM-test; Null hypothesis: no ARCH effects
data: LR_Equity$Mexico
Chi-squared = 9.8561, df = 12, p-value = 0.6286
Null Hypothesis can’t be rejected; Mexico’s returns might not have any conditional heteroscedasticity.
Conclusion: Log returns of all 4, except Mexico has Heteroscedasticity, i.e. error terms doesn’t follow i.i.nd.
Null Hypothesis (H0): The time series data does not exhibit significant autocorrelation up to lag k.
Alternative Hypothesis (H1): The time series data exhibits significant autocorrelation up to lag k.
# Finding optimal lag
VARselect(LR_Equity$Brazil^2, lag.max = 15, type = "const")
$selection
AIC(n) HQ(n) SC(n) FPE(n)
9 5 1 9
$criteria
1 2 3 4 5 6
AIC(n) -1.605313e+01 -1.604981e+01 -1.604805e+01 -1.604491e+01 -1.607183e+01 -1.606848e+01
HQ(n) -1.604741e+01 -1.604122e+01 -1.603661e+01 -1.603061e+01 -1.605466e+01 -1.604846e+01
SC(n) -1.603844e+01 -1.602776e+01 -1.601867e+01 -1.600817e+01 -1.602774e+01 -1.601705e+01
FPE(n) 1.067119e-07 1.070676e-07 1.072552e-07 1.075931e-07 1.047358e-07 1.050865e-07
7 8 9 10 11 12
AIC(n) -1.606521e+01 -1.606476e+01 -1.607687e+01 -1.607494e+01 -1.607186e+01 -1.606927e+01
HQ(n) -1.604232e+01 -1.603902e+01 -1.604827e+01 -1.604347e+01 -1.603753e+01 -1.603208e+01
SC(n) -1.600643e+01 -1.599864e+01 -1.600340e+01 -1.599412e+01 -1.598369e+01 -1.597375e+01
FPE(n) 1.054314e-07 1.054783e-07 1.042090e-07 1.044109e-07 1.047329e-07 1.050047e-07
13 14 15
AIC(n) -1.606714e+01 -1.606383e+01 -1.606052e+01
HQ(n) -1.602709e+01 -1.602092e+01 -1.601476e+01
SC(n) -1.596428e+01 -1.595362e+01 -1.594297e+01
FPE(n) 1.052289e-07 1.055778e-07 1.059275e-07
Optimal Lag = 9
Box.test(LR_Equity$Brazil^2, lag = 9)
Box-Pierce test
data: LR_Equity$Brazil^2
X-squared = 29.835, df = 9, p-value = 0.0004679
Null Hypothesis can be rejected, there is significant autocorrelation at lag = 9.
# Finding optimal lag
VARselect(LR_Equity$Indonesia^2, lag.max = 15, type = "const")
$selection
AIC(n) HQ(n) SC(n) FPE(n)
3 3 3 3
$criteria
1 2 3 4 5 6
AIC(n) -1.788723e+01 -1.788426e+01 -1.795353e+01 -1.795190e+01 -1.794945e+01 -1.794712e+01
HQ(n) -1.788151e+01 -1.787568e+01 -1.794209e+01 -1.793760e+01 -1.793228e+01 -1.792709e+01
SC(n) -1.787254e+01 -1.786222e+01 -1.792414e+01 -1.791516e+01 -1.790536e+01 -1.789569e+01
FPE(n) 1.704803e-08 1.709876e-08 1.595445e-08 1.598048e-08 1.601973e-08 1.605706e-08
7 8 9 10 11 12
AIC(n) -1.794381e+01 -1.794223e+01 -1.793933e+01 -1.793608e+01 -1.793279e+01 -1.794927e+01
HQ(n) -1.792093e+01 -1.791648e+01 -1.791072e+01 -1.790462e+01 -1.789846e+01 -1.791209e+01
SC(n) -1.788503e+01 -1.787610e+01 -1.786585e+01 -1.785527e+01 -1.784462e+01 -1.785376e+01
FPE(n) 1.611029e-08 1.613578e-08 1.618272e-08 1.623527e-08 1.628888e-08 1.602256e-08
13 14 15
AIC(n) -1.794606e+01 -1.794275e+01 -1.794404e+01
HQ(n) -1.790601e+01 -1.789984e+01 -1.789827e+01
SC(n) -1.784320e+01 -1.783254e+01 -1.782648e+01
FPE(n) 1.607419e-08 1.612755e-08 1.610677e-08
Optimal Lag = 3
Box.test(LR_Equity$Indonesia^2, lag = 3)
Box-Pierce test
data: LR_Equity$Indonesia^2
X-squared = 47.135, df = 3, p-value = 3.253e-10
Null Hypothesis can be rejected, there is significant autocorrelation at lag = 3.
# Finding optimal lag
VARselect(LR_Equity$India^2, lag.max = 15, type = "const")
$selection
AIC(n) HQ(n) SC(n) FPE(n)
8 1 1 8
$criteria
1 2 3 4 5 6
AIC(n) -1.650852e+01 -1.650541e+01 -1.651263e+01 -1.650958e+01 -1.650986e+01 -1.650787e+01
HQ(n) -1.650280e+01 -1.649682e+01 -1.650119e+01 -1.649528e+01 -1.649269e+01 -1.648785e+01
SC(n) -1.649382e+01 -1.648336e+01 -1.648324e+01 -1.647285e+01 -1.646577e+01 -1.645644e+01
FPE(n) 6.767721e-08 6.788808e-08 6.739943e-08 6.760504e-08 6.758659e-08 6.772099e-08
7 8 9 10 11 12
AIC(n) -1.651556e+01 -1.652140e+01 -1.651904e+01 -1.651653e+01 -1.651319e+01 -1.651098e+01
HQ(n) -1.649268e+01 -1.649565e+01 -1.649044e+01 -1.648506e+01 -1.647887e+01 -1.647380e+01
SC(n) -1.645679e+01 -1.645527e+01 -1.644557e+01 -1.643571e+01 -1.642503e+01 -1.641547e+01
FPE(n) 6.720200e-08 6.681112e-08 6.696873e-08 6.713733e-08 6.736184e-08 6.751099e-08
13 14 15
AIC(n) -1.650771e+01 -1.650444e+01 -1.650442e+01
HQ(n) -1.646767e+01 -1.646154e+01 -1.645865e+01
SC(n) -1.640485e+01 -1.639424e+01 -1.638687e+01
FPE(n) 6.773211e-08 6.795409e-08 6.795575e-08
Optimal Lag = 8
Box.test(LR_Equity$India^2, lag = 8)
Box-Pierce test
data: LR_Equity$India^2
X-squared = 59.182, df = 8, p-value = 6.743e-10
Null Hypothesis can be rejected, there is significant autocorrelation at lag = 8.
# Finding optimal lag
VARselect(LR_Equity$China^2, lag.max = 15, type = "const")
$selection
AIC(n) HQ(n) SC(n) FPE(n)
2 2 2 2
$criteria
1 2 3 4 5 6
AIC(n) -1.693957e+01 -1.694809e+01 -1.694519e+01 -1.694185e+01 -1.694282e+01 -1.694571e+01
HQ(n) -1.693385e+01 -1.693950e+01 -1.693374e+01 -1.692755e+01 -1.692566e+01 -1.692568e+01
SC(n) -1.692488e+01 -1.692604e+01 -1.691580e+01 -1.690511e+01 -1.689874e+01 -1.689428e+01
FPE(n) 4.397810e-08 4.360535e-08 4.373196e-08 4.387811e-08 4.383564e-08 4.370924e-08
7 8 9 10 11 12
AIC(n) -1.694288e+01 -1.693985e+01 -1.693681e+01 -1.693348e+01 -1.693182e+01 -1.692874e+01
HQ(n) -1.692000e+01 -1.691410e+01 -1.690821e+01 -1.690202e+01 -1.689749e+01 -1.689155e+01
SC(n) -1.688410e+01 -1.687372e+01 -1.686334e+01 -1.685266e+01 -1.684365e+01 -1.683322e+01
FPE(n) 4.383305e-08 4.396618e-08 4.409994e-08 4.424704e-08 4.432085e-08 4.445761e-08
13 14 15
AIC(n) -1.692679e+01 -1.692454e+01 -1.692244e+01
HQ(n) -1.688675e+01 -1.688164e+01 -1.687667e+01
SC(n) -1.682393e+01 -1.681434e+01 -1.680488e+01
FPE(n) 4.454412e-08 4.464454e-08 4.473879e-08
Optimal Lag = 2
Box.test(LR_Equity$China^2, lag = 2)
Box-Pierce test
data: LR_Equity$China^2
X-squared = 43.099, df = 2, p-value = 4.376e-10
Null Hypothesis can be rejected, there is significant autocorrelation at lag = 3.
VARselect(LR_Equity$Mexico^2, lag.max = 15, type = "const")
$selection
AIC(n) HQ(n) SC(n) FPE(n)
1 1 1 1
$criteria
1 2 3 4 5 6
AIC(n) -1.617729e+01 -1.617448e+01 -1.617218e+01 -1.617039e+01 -1.617530e+01 -1.617216e+01
HQ(n) -1.617156e+01 -1.616590e+01 -1.616074e+01 -1.615609e+01 -1.615813e+01 -1.615213e+01
SC(n) -1.616259e+01 -1.615244e+01 -1.614279e+01 -1.613366e+01 -1.613121e+01 -1.612073e+01
FPE(n) 9.425279e-08 9.451743e-08 9.473516e-08 9.490457e-08 9.444058e-08 9.473765e-08
7 8 9 10 11 12
AIC(n) -1.616962e+01 -1.616696e+01 -1.616361e+01 -1.616075e+01 -1.615751e+01 -1.615439e+01
HQ(n) -1.614674e+01 -1.614121e+01 -1.613501e+01 -1.612928e+01 -1.612319e+01 -1.611720e+01
SC(n) -1.611085e+01 -1.610083e+01 -1.609014e+01 -1.607993e+01 -1.606935e+01 -1.605888e+01
FPE(n) 9.497783e-08 9.523158e-08 9.555069e-08 9.582494e-08 9.613551e-08 9.643640e-08
13 14 15
AIC(n) -1.615252e+01 -1.614954e+01 -1.614687e+01
HQ(n) -1.611247e+01 -1.610663e+01 -1.610111e+01
SC(n) -1.604966e+01 -1.603933e+01 -1.602932e+01
FPE(n) 9.661728e-08 9.690579e-08 9.716438e-08
Optimal Lag = 1
Box.test(LR_Equity$Mexico^2, lag = 1)
Box-Pierce test
data: LR_Equity$Mexico^2
X-squared = 1.6664, df = 1, p-value = 0.1967
Null Hypothesis can’t be rejected, there is no significant autocorrelation at lag = 1.
Conclusion: It confirms again that except Mexican market all other markets exhibit ARCH effects or Volatility Clustering.
Alpha (α): This coefficient captures the short-term persistence of volatility. It reflects the impact of recent shocks on current volatility. A high alpha indicates that recent news has a strong influence on volatility.
Beta (β): This coefficient measures the long-term persistence of volatility. It represents the effect of past conditional variances on current variance. A high beta suggests that volatility is highly persistent over time.
Volatility Persistence (α+β): If this sum is close to 1, volatility is very persistent, and the impact of shocks diminishes slowly.
# Specify the GARCH(1,1) model
brazil_spec <- ugarchspec(
variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
mean.model = list(armaOrder = c(0, 0), include.mean = TRUE)
)
# Fit the model
brazil_garch_fit <- ugarchfit(spec = brazil_spec, data = LR_Equity$Brazil)
brazil_garch_fit
*---------------------------------*
* GARCH Model Fit *
*---------------------------------*
Conditional Variance Dynamics
-----------------------------------
GARCH Model : sGARCH(1,1)
Mean Model : ARFIMA(0,0,0)
Distribution : norm
Optimal Parameters
------------------------------------
Estimate Std. Error t value Pr(>|t|)
mu 0.000179 0.000469 0.381386 0.70292
omega 0.000000 0.000000 0.000001 1.00000
alpha1 0.019367 0.003585 5.401507 0.00000
beta1 0.979111 0.003638 269.158389 0.00000
Robust Standard Errors:
Estimate Std. Error t value Pr(>|t|)
mu 0.000179 0.000471 0.380289 0.703731
omega 0.000000 0.000001 0.000001 1.000000
alpha1 0.019367 0.006450 3.002695 0.002676
beta1 0.979111 0.007301 134.111088 0.000000
LogLikelihood : 1820.544
Information Criteria
------------------------------------
Akaike -5.9267
Bayes -5.8979
Shibata -5.9268
Hannan-Quinn -5.9155
Weighted Ljung-Box Test on Standardized Residuals
------------------------------------
statistic p-value
Lag[1] 0.1063 0.7444
Lag[2*(p+q)+(p+q)-1][2] 1.6497 0.3281
Lag[4*(p+q)+(p+q)-1][5] 4.1289 0.2384
d.o.f=0
H0 : No serial correlation
Weighted Ljung-Box Test on Standardized Squared Residuals
------------------------------------
statistic p-value
Lag[1] 1.772 0.18311
Lag[2*(p+q)+(p+q)-1][5] 5.214 0.13684
Lag[4*(p+q)+(p+q)-1][9] 10.097 0.04782
d.o.f=2
Weighted ARCH LM Tests
------------------------------------
Statistic Shape Scale P-Value
ARCH Lag[3] 0.01268 0.500 2.000 0.91033
ARCH Lag[5] 7.19467 1.440 1.667 0.03130
ARCH Lag[7] 9.08984 2.315 1.543 0.02982
Nyblom stability test
------------------------------------
Joint Statistic: 108.2057
Individual Statistics:
mu 0.1240
omega 21.1131
alpha1 0.3347
beta1 0.3500
Asymptotic Critical Values (10% 5% 1%)
Joint Statistic: 1.07 1.24 1.6
Individual Statistic: 0.35 0.47 0.75
Sign Bias Test
------------------------------------
Adjusted Pearson Goodness-of-Fit Test:
------------------------------------
group statistic p-value(g-1)
1 20 15.94 0.6613
2 30 30.02 0.4131
3 40 32.29 0.7680
4 50 57.72 0.1841
Elapsed time : 0.1228669
alpha1 (ARCH term): The estimate is 0.019367 with a p-value of 0.00000. This indicates that the ARCH effect is highly significant (p-value < 0.05).
beta1 (GARCH term): The estimate is 0.979111 with a p-value of 0.00000. This suggests that the GARCH effect is also highly significant.
Weighted Ljung-Box Test on Standardized Residuals: The p-values for lags 1, 2, and 4 are all greater than 0.05 (0.7444, 0.3281, 0.2384), indicating no significant serial autocorrelation in the standardized residuals.
Weighted Ljung-Box Test on Standardized Squared Residuals: The p-value for lag 4 is 0.04782, which is slightly below 0.05, indicating GARCH might not have captured volatility clustering completely.
ARCH LM Tests: Lag 5 and Lag 7 show p-values below 0.05, indicating that there is evidence of ARCH effects remaining at these lags.
Sign Bias Test: Since all the p-values are above 0.05, this indicates that there are no asymmetries in how positive and negative shocks impact the volatility.
Overall, the model is a good fit, but we can possibly explore other symmetrical models for a better fit.
brazil_forecast = ugarchforecast(brazil_garch_fit, n.ahead = 10)
brazil_forecast
*------------------------------------*
* GARCH Model Forecast *
*------------------------------------*
Model: sGARCH
Horizon: 10
Roll Steps: 0
Out of Sample: 0
0-roll forecast [T0=1971-09-06]:
Series Sigma
T+1 0.0001789 0.007476
T+2 0.0001789 0.007471
T+3 0.0001789 0.007465
T+4 0.0001789 0.007459
T+5 0.0001789 0.007454
T+6 0.0001789 0.007448
T+7 0.0001789 0.007442
T+8 0.0001789 0.007437
T+9 0.0001789 0.007431
T+10 0.0001789 0.007425
plot(brazil_forecast)
Make a plot selection (or 0 to exit):
1: Time Series Prediction (unconditional)
2: Time Series Prediction (rolling)
3: Sigma Prediction (unconditional)
4: Sigma Prediction (rolling)
1
Make a plot selection (or 0 to exit):
1: Time Series Prediction (unconditional)
2: Time Series Prediction (rolling)
3: Sigma Prediction (unconditional)
4: Sigma Prediction (rolling)
3
Make a plot selection (or 0 to exit):
1: Time Series Prediction (unconditional)
2: Time Series Prediction (rolling)
3: Sigma Prediction (unconditional)
4: Sigma Prediction (rolling)
0
# Specify the GARCH(1,1) model
indonesia_spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1)), mean.model = list(armaOrder = c(0, 0), include.mean = TRUE))
# Fit the model
indonesia_garch_fit <- ugarchfit(spec = indonesia_spec, data = LR_Equity$Indonesia)
indonesia_garch_fit
*---------------------------------*
* GARCH Model Fit *
*---------------------------------*
Conditional Variance Dynamics
-----------------------------------
GARCH Model : sGARCH(1,1)
Mean Model : ARFIMA(0,0,0)
Distribution : norm
Optimal Parameters
------------------------------------
Estimate Std. Error t value Pr(>|t|)
mu 0.000322 0.000295 1.0924 0.27466
omega 0.000010 0.000000 82.2945 0.00000
alpha1 0.106284 0.012161 8.7400 0.00000
beta1 0.724521 0.024630 29.4163 0.00000
Robust Standard Errors:
Estimate Std. Error t value Pr(>|t|)
mu 0.000322 0.000292 1.1033 0.2699
omega 0.000010 0.000000 82.7278 0.0000
alpha1 0.106284 0.019347 5.4937 0.0000
beta1 0.724521 0.042790 16.9318 0.0000
LogLikelihood : 2121.832
Information Criteria
------------------------------------
Akaike -6.9097
Bayes -6.8809
Shibata -6.9098
Hannan-Quinn -6.8985
Weighted Ljung-Box Test on Standardized Residuals
------------------------------------
statistic p-value
Lag[1] 1.660 0.1976
Lag[2*(p+q)+(p+q)-1][2] 1.669 0.3242
Lag[4*(p+q)+(p+q)-1][5] 3.722 0.2908
d.o.f=0
H0 : No serial correlation
Weighted Ljung-Box Test on Standardized Squared Residuals
------------------------------------
statistic p-value
Lag[1] 0.1022 0.7492
Lag[2*(p+q)+(p+q)-1][5] 1.9602 0.6279
Lag[4*(p+q)+(p+q)-1][9] 2.6418 0.8163
d.o.f=2
Weighted ARCH LM Tests
------------------------------------
Statistic Shape Scale P-Value
ARCH Lag[3] 2.221 0.500 2.000 0.1361
ARCH Lag[5] 2.500 1.440 1.667 0.3709
ARCH Lag[7] 2.636 2.315 1.543 0.5847
Nyblom stability test
------------------------------------
Joint Statistic: 36.3777
Individual Statistics:
mu 0.04386
omega 4.85238
alpha1 0.12508
beta1 0.28298
Asymptotic Critical Values (10% 5% 1%)
Joint Statistic: 1.07 1.24 1.6
Individual Statistic: 0.35 0.47 0.75
Sign Bias Test
------------------------------------
Adjusted Pearson Goodness-of-Fit Test:
------------------------------------
group statistic p-value(g-1)
1 20 23.97 0.19747
2 30 43.04 0.04518
3 40 58.13 0.02497
4 50 55.76 0.23562
Elapsed time : 0.1867142
alpha1 (ARCH term): The ARCH effect is highly significant (p-value < 0.05).
beta1 (GARCH term): The GARCH effect is also highly significant (p-value < 0.05).
Weighted Ljung-Box Test on Standardized Residuals: The p-values for lags 1, 2, and 4 are all greater than 0.05, indicating no significant serial autocorrelation in the standardized residuals.
Weighted Ljung-Box Test on Standardized Squared Residuals: TThe p-values for lags 1, 2, and 4 are all greater than 0.05, indicating that model have captured volatility clustering.
ARCH LM Tests: All p-values above 0.05, indicating that there are no ARCH effects remaining.
Sign Bias Test: Since all the p-values are above 0.05, this indicates that there are no asymmetries in how positive and negative shocks impact the volatility.
Overall the model is a good fit.
indonesia_forecast = ugarchforecast(indonesia_garch_fit, n.ahead = 10)
indonesia_forecast
*------------------------------------*
* GARCH Model Forecast *
*------------------------------------*
Model: sGARCH
Horizon: 10
Roll Steps: 0
Out of Sample: 0
0-roll forecast [T0=1971-09-06]:
Series Sigma
T+1 0.000322 0.007265
T+2 0.000322 0.007356
T+3 0.000322 0.007431
T+4 0.000322 0.007492
T+5 0.000322 0.007543
T+6 0.000322 0.007585
T+7 0.000322 0.007620
T+8 0.000322 0.007649
T+9 0.000322 0.007673
T+10 0.000322 0.007692
plot(indonesia_forecast)
Make a plot selection (or 0 to exit):
1: Time Series Prediction (unconditional)
2: Time Series Prediction (rolling)
3: Sigma Prediction (unconditional)
4: Sigma Prediction (rolling)
1
Make a plot selection (or 0 to exit):
1: Time Series Prediction (unconditional)
2: Time Series Prediction (rolling)
3: Sigma Prediction (unconditional)
4: Sigma Prediction (rolling)
3
Make a plot selection (or 0 to exit):
1: Time Series Prediction (unconditional)
2: Time Series Prediction (rolling)
3: Sigma Prediction (unconditional)
4: Sigma Prediction (rolling)
0
# Specify the GARCH(1,1) model
india_spec <- ugarchspec(
variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
mean.model = list(armaOrder = c(0, 0), include.mean = TRUE))
# Fit the model
india_garch_fit <- ugarchfit(spec = india_spec, data = LR_Equity$India)
india_garch_fit
*---------------------------------*
* GARCH Model Fit *
*---------------------------------*
Conditional Variance Dynamics
-----------------------------------
GARCH Model : sGARCH(1,1)
Mean Model : ARFIMA(0,0,0)
Distribution : norm
Optimal Parameters
------------------------------------
Estimate Std. Error t value Pr(>|t|)
mu 0.001151 0.000355 3.2460 0.00117
omega 0.000008 0.000001 11.6003 0.00000
alpha1 0.146746 0.020439 7.1797 0.00000
beta1 0.779105 0.025187 30.9322 0.00000
Robust Standard Errors:
Estimate Std. Error t value Pr(>|t|)
mu 0.001151 0.000400 2.8807 0.003968
omega 0.000008 0.000001 7.0624 0.000000
alpha1 0.146746 0.031928 4.5961 0.000004
beta1 0.779105 0.039053 19.9500 0.000000
LogLikelihood : 1999.105
Information Criteria
------------------------------------
Akaike -6.5093
Bayes -6.4805
Shibata -6.5094
Hannan-Quinn -6.4981
Weighted Ljung-Box Test on Standardized Residuals
------------------------------------
statistic p-value
Lag[1] 0.07896 0.7787
Lag[2*(p+q)+(p+q)-1][2] 0.09705 0.9217
Lag[4*(p+q)+(p+q)-1][5] 1.27605 0.7947
d.o.f=0
H0 : No serial correlation
Weighted Ljung-Box Test on Standardized Squared Residuals
------------------------------------
statistic p-value
Lag[1] 1.510 0.2192
Lag[2*(p+q)+(p+q)-1][5] 2.988 0.4092
Lag[4*(p+q)+(p+q)-1][9] 4.757 0.4660
d.o.f=2
Weighted ARCH LM Tests
------------------------------------
Statistic Shape Scale P-Value
ARCH Lag[3] 0.2228 0.500 2.000 0.6369
ARCH Lag[5] 0.4644 1.440 1.667 0.8941
ARCH Lag[7] 0.9722 2.315 1.543 0.9180
Nyblom stability test
------------------------------------
Joint Statistic: 5.5123
Individual Statistics:
mu 0.08033
omega 2.52913
alpha1 0.27316
beta1 0.55558
Asymptotic Critical Values (10% 5% 1%)
Joint Statistic: 1.07 1.24 1.6
Individual Statistic: 0.35 0.47 0.75
Sign Bias Test
------------------------------------
Adjusted Pearson Goodness-of-Fit Test:
------------------------------------
group statistic p-value(g-1)
1 20 45.76 0.0005359
2 30 55.96 0.0019130
3 40 64.39 0.0064265
4 50 82.51 0.0019342
Elapsed time : 0.2009952
alpha1 (ARCH term): The ARCH effect is highly significant (p-value < 0.05).
beta1 (GARCH term): The GARCH effect is also highly significant (p-value < 0.05).
Weighted Ljung-Box Test on Standardized Residuals: The p-values for lags 1, 2, and 4 are all greater than 0.05, indicating no significant serial autocorrelation in the standardized residuals.
Weighted Ljung-Box Test on Standardized Squared Residuals: The p-values for lags 1, 2, and 4 are all greater than 0.05, indicating that model have captured volatility clustering.
ARCH LM Tests: All p-values above 0.05, indicating that there are no ARCH effects remaining.
Sign Bias Test: Since all the p-values are above 0.05, this indicates that there are no asymmetries in how positive and negative shocks impact the volatility.
Overall the model is a good fit.
india_forecast = ugarchforecast(india_garch_fit, n.ahead = 10)
india_forecast
*------------------------------------*
* GARCH Model Forecast *
*------------------------------------*
Model: sGARCH
Horizon: 10
Roll Steps: 0
Out of Sample: 0
0-roll forecast [T0=1971-09-06]:
Series Sigma
T+1 0.001151 0.007464
T+2 0.001151 0.007718
T+3 0.001151 0.007945
T+4 0.001151 0.008150
T+5 0.001151 0.008336
T+6 0.001151 0.008504
T+7 0.001151 0.008657
T+8 0.001151 0.008796
T+9 0.001151 0.008922
T+10 0.001151 0.009038
plot(india_forecast)
Make a plot selection (or 0 to exit):
1: Time Series Prediction (unconditional)
2: Time Series Prediction (rolling)
3: Sigma Prediction (unconditional)
4: Sigma Prediction (rolling)
1
Make a plot selection (or 0 to exit):
1: Time Series Prediction (unconditional)
2: Time Series Prediction (rolling)
3: Sigma Prediction (unconditional)
4: Sigma Prediction (rolling)
3
Make a plot selection (or 0 to exit):
1: Time Series Prediction (unconditional)
2: Time Series Prediction (rolling)
3: Sigma Prediction (unconditional)
4: Sigma Prediction (rolling)
0
# Specify the GARCH(1,1) model
china_spec <- ugarchspec(
variance.model = list(model = "sGARCH", garchOrder = c(1, 1)),
mean.model = list(armaOrder = c(0, 0), include.mean = TRUE))
# Fit the model
china_garch_fit <- ugarchfit(spec = china_spec, data = LR_Equity$China)
china_garch_fit
*---------------------------------*
* GARCH Model Fit *
*---------------------------------*
Conditional Variance Dynamics
-----------------------------------
GARCH Model : sGARCH(1,1)
Mean Model : ARFIMA(0,0,0)
Distribution : norm
Optimal Parameters
------------------------------------
Estimate Std. Error t value Pr(>|t|)
mu -0.000283 0.000362 -0.78095 0.43483
omega 0.000005 0.000001 7.33762 0.00000
alpha1 0.076467 0.011271 6.78413 0.00000
beta1 0.870066 0.017019 51.12368 0.00000
Robust Standard Errors:
Estimate Std. Error t value Pr(>|t|)
mu -0.000283 0.000339 -0.83368 0.40446
omega 0.000005 0.000001 5.33203 0.00000
alpha1 0.076467 0.008961 8.53290 0.00000
beta1 0.870066 0.013847 62.83572 0.00000
LogLikelihood : 1986.059
Information Criteria
------------------------------------
Akaike -6.4668
Bayes -6.4379
Shibata -6.4668
Hannan-Quinn -6.4555
Weighted Ljung-Box Test on Standardized Residuals
------------------------------------
statistic p-value
Lag[1] 0.02683 0.8699
Lag[2*(p+q)+(p+q)-1][2] 0.09168 0.9255
Lag[4*(p+q)+(p+q)-1][5] 2.66366 0.4719
d.o.f=0
H0 : No serial correlation
Weighted Ljung-Box Test on Standardized Squared Residuals
------------------------------------
statistic p-value
Lag[1] 0.354 0.5519
Lag[2*(p+q)+(p+q)-1][5] 1.775 0.6724
Lag[4*(p+q)+(p+q)-1][9] 2.516 0.8354
d.o.f=2
Weighted ARCH LM Tests
------------------------------------
Statistic Shape Scale P-Value
ARCH Lag[3] 0.02056 0.500 2.000 0.8860
ARCH Lag[5] 0.98330 1.440 1.667 0.7379
ARCH Lag[7] 1.14322 2.315 1.543 0.8892
Nyblom stability test
------------------------------------
Joint Statistic: 4.5902
Individual Statistics:
mu 0.07227
omega 0.93555
alpha1 0.14935
beta1 0.16504
Asymptotic Critical Values (10% 5% 1%)
Joint Statistic: 1.07 1.24 1.6
Individual Statistic: 0.35 0.47 0.75
Sign Bias Test
------------------------------------
Adjusted Pearson Goodness-of-Fit Test:
------------------------------------
group statistic p-value(g-1)
1 20 28.99 0.066139
2 30 45.09 0.028828
3 40 60.08 0.016627
4 50 80.88 0.002796
Elapsed time : 0.2192121
alpha1 (ARCH term): The ARCH effect is highly significant (p-value < 0.05).
beta1 (GARCH term): The GARCH effect is also highly significant (p-value < 0.05).
Weighted Ljung-Box Test on Standardized Residuals: The p-values for lags 1, 2, and 4 are all greater than 0.05, indicating no significant serial autocorrelation in the standardized residuals.
Weighted Ljung-Box Test on Standardized Squared Residuals: The p-values for lags 1, 2, and 4 are all greater than 0.05, indicating that model have captured volatility clustering.
ARCH LM Tests: All p-values above 0.05, indicating that there are no ARCH effects remaining.
Sign Bias Test: Since all the p-values are above 0.05, this indicates that there are no asymmetries in how positive and negative shocks impact the volatility.
Overall the model is a good fit.
{r} india_forecast = ugarchforecast(india_garch_fit, n.ahead = 10) india_forecast}
{r} plot(india_forecast)}
# Specify the GARCH(0,1) model
mexico_spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(0, 1)), mean.model = list(armaOrder = c(0, 0), include.mean = TRUE))
# Fit the model
mexico_garch_fit <- ugarchfit(spec = mexico_spec, data = LR_Equity$Indonesia)
mexico_garch_fit
Kept ARCH Order = 0, because there were no ARCH effects in Mexican Stocks.
beta1 (GARCH term): The GARCH effect is also highly significant (p-value < 0.05).
Weighted Ljung-Box Test on Standardized Residuals: The p-values for lags 1, 2, and 4 are all greater than 0.05, indicating no significant serial autocorrelation in the standardized residuals.
Sign Bias Test: Since all the p-values are above 0.05, this indicates that there are no asymmetries in how positive and negative shocks impact the volatility.
Overall the model is a good fit.
# Specify the GARCH(0,1) model
mexico_spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(0, 1)), mean.model = list(armaOrder = c(0, 0), include.mean = TRUE))
# Fit the model
mexico_garch_fit <- ugarchfit(spec = mexico_spec, data = LR_Equity$Indonesia)
mexico_garch_fit
*---------------------------------*
* GARCH Model Fit *
*---------------------------------*
Conditional Variance Dynamics
-----------------------------------
GARCH Model : sGARCH(0,1)
Mean Model : ARFIMA(0,0,0)
Distribution : norm
Optimal Parameters
------------------------------------
Estimate Std. Error t value Pr(>|t|)
mu 0.000304 0.000315 9.6552e-01 0.33429
omega 0.000000 0.000000 3.4654e+01 0.00000
beta1 0.993221 0.000030 3.2576e+04 0.00000
Robust Standard Errors:
Estimate Std. Error t value Pr(>|t|)
mu 0.000304 0.000326 0.93354 0.35054
omega 0.000000 0.000000 32.50106 0.00000
beta1 0.993221 0.000351 2828.42254 0.00000
LogLikelihood : 2106.857
Information Criteria
------------------------------------
Akaike -6.8641
Bayes -6.8425
Shibata -6.8642
Hannan-Quinn -6.8557
Weighted Ljung-Box Test on Standardized Residuals
------------------------------------
statistic p-value
Lag[1] 1.740 0.1871
Lag[2*(p+q)+(p+q)-1][2] 1.749 0.3081
Lag[4*(p+q)+(p+q)-1][5] 4.371 0.2112
d.o.f=0
H0 : No serial correlation
Weighted Ljung-Box Test on Standardized Squared Residuals
------------------------------------
statistic p-value
Lag[1] 4.147 4.171e-02
Lag[2*(p+q)+(p+q)-1][2] 4.357 6.048e-02
Lag[4*(p+q)+(p+q)-1][5] 31.076 1.573e-08
d.o.f=1
Weighted ARCH LM Tests
------------------------------------
Statistic Shape Scale P-Value
ARCH Lag[2] 0.4168 0.500 2.000 5.185e-01
ARCH Lag[4] 33.2484 1.397 1.611 4.156e-09
ARCH Lag[6] 39.3139 2.222 1.500 2.107e-10
Nyblom stability test
------------------------------------
Joint Statistic: 4.5649
Individual Statistics:
mu 0.06863
omega 2.26480
beta1 0.40678
Asymptotic Critical Values (10% 5% 1%)
Joint Statistic: 0.846 1.01 1.35
Individual Statistic: 0.35 0.47 0.75
Sign Bias Test
------------------------------------
Adjusted Pearson Goodness-of-Fit Test:
------------------------------------
group statistic p-value(g-1)
1 20 22.14 0.2774
2 30 28.45 0.4939
3 40 35.29 0.6400
4 50 43.36 0.7002
Elapsed time : 0.1178162
mexico_forecast = ugarchforecast(mexico_garch_fit, n.ahead = 10)
mexico_forecast
*------------------------------------*
* GARCH Model Forecast *
*------------------------------------*
Model: sGARCH
Horizon: 10
Roll Steps: 0
Out of Sample: 0
0-roll forecast [T0=1971-09-06]:
Series Sigma
T+1 0.0003041 0.007595
T+2 0.0003041 0.007595
T+3 0.0003041 0.007595
T+4 0.0003041 0.007595
T+5 0.0003041 0.007595
T+6 0.0003041 0.007594
T+7 0.0003041 0.007594
T+8 0.0003041 0.007594
T+9 0.0003041 0.007594
T+10 0.0003041 0.007594
We’ve forecasted the log returns of all the series using GARCH Models. Stock markets of all other countries exhibited volatility clustering, except the Mexican markets.